home *** CD-ROM | disk | FTP | other *** search
- /******************************************************************************
-
- cdwacc.h
-
- Purpose: CD Writer Access library header file
-
- Author: MM, RSJ Software
-
- Date: 04/98
-
- Copyright (c) 1997-2001 by RSJ Software GmbH, Germering.
- All rights reserved.
-
- ******************************************************************************/
-
- #ifndef _CDWACC_H_
- #define _CDWACC_H_
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #pragma pack(1)
-
- /*------- defines -----------------------------------------------------------*/
-
- /*******************************************************************************
- 'CDWACCRET' defines all available return codes from calls to the CD library
- functions (such as the track copy library).
-
- NOTES: CDWACCRET is not defined as an enum to allow using these constants
- together with resource compilers and alike.
-
- Although defined in groups, expect each error to be returned by
- any call.
- *******************************************************************************/
-
- #define CDWACC_OK 0 /* no error */
-
- /* general errors */
- #define CDWACC_FAILED_TO_OPEN 1 /* failed to open VXD */
- #define CDWACC_INVALID_PARM 2 /* invalid parameter was passed */
-
- /* opening the device */
- #define CDWACC_DEVICE_NOT_FOUND 100 /* device could not be found */
- #define CDWACC_FILE_NOT_FOUND 101 /* file could not be found (cdfile) */
- #define CDWACC_PATH_NOT_FOUND 102 /* path could not be found (cdfile) */
- #define CDWACC_ACCESS_DENIED 103 /* access denied for some reason */
- #define CDWACC_DEVICE_LOCKED 104 /* device locked by another process */
- #define CDWACC_INVALID_DEVICE 105 /* invalid device type */
- #define CDWACC_INVALID_DRIVER 106 /* driver module in error */
- #define CDWACC_NOT_READY 107 /* device not ready */
- #define CDWACC_OUTOFMEM 108 /* out of memory */
-
- /* working with the device */
- #define CDWACC_ARENA_TRASHED 200 /* internal control structures damaged */
- #define CDWACC_INVALID_HANDLE 201 /* invalid device handle */
- #define CDWACC_INVALID_FUNC 202 /* invalid function */
- #define CDWACC_INVALID_DATA 203 /* invalid data for function */
- #define CDWACC_NOT_SUPPORTED 204 /* function not supported */
- #define CDWACC_IOCTL_ERROR 205 /* generic IOCtl error */
- #define CDWACC_UNIT_ATTENTION 206 /* illegal medium change */
- #define CDWACC_RECORDER_BUSY 207 /* recorder cannot process the requested
- command at this time */
- #define CDWACC_INTERRUPTED 208 /* the command has been interrupted */
- #define CDWACC_NOBLANKIFCHANGED 209 /* CD has been modified in current session
- and cannot be blanked; close it first */
-
- /* reading and writing */
- #define CDWACC_WRITE_PROTECT 300 /* medium and/or device write protected */
- #define CDWACC_DISK_FULL 301 /* disk full */
- #define CDWACC_CRC_ERROR 302 /* data error (read or write) */
- #define CDWACC_SEEK_ERROR 303 /* sector address out of range */
- #define CDWACC_READ_ERROR 304 /* logical read error */
- #define CDWACC_WRITE_ERROR 305 /* logical write error */
- #define CDWACC_GEN_FAILURE 306 /* general failure */
- #define CDWACC_FLUSH_FAILED 307 /* FLUSH CACHE command failed, but drive is not in write mode anymore */
-
- /* copying tracks */
- #define CDWACC_BUFFER_UNDERRUN 400 /* data could not be written in time */
- #define CDWACC_COPY_ABORTED 401 /* operator has cancelled the copy operation */
- #define CDWACC_BUFFER_OVERFLOW 402 /* audio data could not be read in time */
-
- /* file system errors */
- #define CDWACC_INVALID_FORMAT 500 /* invalid file system format */
- #define CDWACC_NO_MORE_HANDLES 501 /* no more handles available (out of memory) */
- #define CDWACC_NO_MORE_FILES 502 /* no more files in this directory */
- #define CDWACC_INVALID_DIRECTORY 503 /* invalid directory in path name */
- #define CDWACC_DIR_NOT_EMPTY 505 /* directory is not empty (rmdir) */
- #define CDWACC_NEGATIVE_SEEK 506 /* negative seek offset */
- #define CDWACC_SHARING_VIOLATION 507 /* file already used by someone else */
- #define CDWACC_ADDRESS_CHANGED 508 /* locked cache file or write handle could not be written at the predetermined address */
- #define CDWACC_CACHE_FULL 509 /* the 2nd-level cache is full */
- #define CDWACC_FILE_TOO_SMALL 510 /* file is to small to be copied directly (use standard copy algorithm instead) */
-
- /* use a generic data type to prevent sizeof() trouble */
- typedef short CDWACCRET;
-
- #define CDWACCLNK extern CDWACCRET __stdcall
-
- /*------- typedefs ----------------------------------------------------------*/
- /******************************************************************************
- NOTE:
- All structures have a 'cb' member wich must hold the size of the structure
- before calling any function.
- ******************************************************************************/
-
- /******************************************************************************
- DRVMAP
- receives all drive letters handled by the RSJ CD Writer Filesystem
- (i.e. if DRVMAP contains 'DEF' drives D:, E: and F: are CDWFS drives)
- ******************************************************************************/
- typedef char DRVMAP[25];
-
- /******************************************************************************
- 'CDWACC_FINALIZE_MODE' defines the various modes available for the
- 'cdwFinalize' function.
- ******************************************************************************/
- typedef enum {
- CDWACC_FINALIZE_NONE, /* just detach drive
- (no data written, no buffers flushed!) */
- CDWACC_FINALIZE_CACHE, /* write cache buffer to disk -
- not needed anymore (only for compatibility
- reasons) */
- CDWACC_FINALIZE_DIRECTORY, /* write cache buffer + directory to disk */
- CDWACC_FINALIZE_SESSION, /* write PVD + session header to disk */
- CDWACC_FINALIZE_SEAL /* like FLUSH_SESSION, but make CD read-only */
- } enum_CDWACC_FINALIZE_MODE;
-
- /* use a short to prevent sizeof(enum) differences */
- typedef short CDWACC_FINALIZE_MODE;
-
- /*******************************************************************************
- 'CDWACC_TRACK_MODE' defines all available track modes.
- *******************************************************************************/
- typedef enum {
- CDWACC_TM_MODE1 = 0x01, /* CDROM, 2048 bytes, ECC */
- CDWACC_TM_MODE2 = 0x02 /* CD XA, 2048-2324 bytes */
- } enum_CDWACC_TRACK_MODE;
-
- /* use a short to prevent sizeof(enum) differences */
- typedef short CDWACC_TRACK_MODE;
-
-
- /******************************************************************************
- 'CDWACC_CD_INFO' contains information about the CD. This includes
- track/session information, information about the number of files and
- directories on the CD
-
- Used by the 'cdwGetCDInfo ' function
-
- NOTE: We're using longs for all fields to prevent problems with languages
- like Visual Basic
- ******************************************************************************/
- typedef struct {
- long cb; /* size of structure */
- long file_count; /* number of files on the CD */
- long dir_count; /* number of directories on the CD */
- long file_disk_usage; /* volume space occupied by files */
- long dir_disk_usage; /* volume space occupied by directories */
-
- long finalized_sessions; /* number of finalized sessions on the CD */
- long open_session; /* currently open session */
- long track_count; /* number of tracks on the CD */
- long reserved_track; /* currently reserved track */
- long fixation_recommended; /* power calibration area almost full */
- long modified; /* CD has been modified */
-
- } CDWACC_CD_INFO;
-
- /******************************************************************************
- 'CDWACC_VOL_INFO'
- not needed yet since setting and retrievinbg volume information is not
- yet supported
- this will be added in a future release
- ******************************************************************************/
- typedef struct {
- unsigned short cb; /* size of structure */
- } CDWACC_VOL_INFO;
-
- /*******************************************************************************
- 'CDWACC_FSPARMS' contains general information about the file system status
- and its environment.
-
- NOTE: We're using longs for all fields to prevent problems with languages
- like Visual Basic
- *******************************************************************************/
- typedef struct {
- long cb; /* size of structure */
-
- /* parameters which can be modified anytime */
- long debug; /* print debug messages */
- long eject; /* eject CD after finalizing */
- long nolock; /* don't lock drive door while
- CD is mounted */
- long speed; /* speed factor (1 = 150K, 2 = 300K, ...) */
- long emulation; /* emulation write */
- long nozap; /* prevent overwriting or deleting files
- not implemented yet in Win95 */
- long tmode; /* track mode for next track */
- long iso_level; /* ISO9660 Information Interchange Level
- (determines how ISO9660 filenames are built
- when closing the CD) */
-
- /* parameters which can only be changed during 'fsMount()' */
- unsigned long cache_1; /* size of RAM cache (in KB) */
- unsigned long cache_2; /* size of second level cache
- (ignored on Windows systems) */
- char cache_path[260];
- /* path where the 2nd-level cache
- files will be placed
- (ignored on Windows systems) */
-
- /* parameters which can only be read */
- long ver_major; /* major file system version number */
- long ver_minor; /* minor file system version number */
-
- } CDWACC_FSPARMS;
-
- /*******************************************************************************
- 'CDWACC_DEV_TYPE' defines all supported CD device types.
- *******************************************************************************/
- typedef enum {
- CDWACC_DVT_CDROM, /* CDROM drive */
- CDWACC_DVT_CDREC, /* CD recorder */
- CDWACC_DVT_CDRW, /* CD recorder with RW capabilities */
- CDWACC_DVT_HD /* hard disk (CDR emulation)
- (not used with the file system) */
- } enum_CDWACC_DEV_TYPE;
-
- /* use a long to prevent sizeof(enum) differences */
- typedef long CDWACC_DEV_TYPE;
-
-
- /*******************************************************************************
- 'CDWACC_DEV_CAPS' contains information about the device capabilities.
- NOTE: We're using longs for all fields to prevent problems with languages
- like Visual Basic
- *******************************************************************************/
-
- /*-------- TAO/DAO support bits (set in 'writable') --------------------------*/
- #define CDWACC_TAO_SUPPORTED 0x01
- #define CDWACC_DAO_SUPPORTED 0x02
-
- typedef struct {
- long cb; /* size of structure */
- long removable; /* device uses removable media */
- long writable; /* device is able to write data;
- * also contains TAO/DAO bits */
- long session; /* device supports (or needs) sessions */
- long rmtrack; /* device can remove single tracks */
-
- /* audio parameters are not used with the file system */
- long read_audio; /* device can read audio tracks */
- long play_audio; /* device can play audio tracks */
-
- long speed_count; /* number of possible speeds */
- long speed_table[20]; /* array with possible recording speed factors */
-
- long dev_type; /* type of CD recorder */
-
- } CDWACC_DEV_CAPS;
-
-
- #pragma pack()
-
-
- /*------- function prototypes -----------------------------------------------*/
- /******************************************************************************
-
- NOTES:
- Most functions expect a drive as input parameter. This should be in the
- format "<drive_letter>:" (not case sensitive)
- for example
- F:
-
- ******************************************************************************/
-
- /******************************************************************************
- 'cdwGetDriveLetters' returns the drive letters handled by the CD Writer File
- system in a character array.
- (i.e. if DRVMAP contains 'DEF' then drives D:, E: and F: are CDWFS drives)
- ******************************************************************************/
- CDWACCLNK cdwGetDrvLetters (DRVMAP drvmap);
-
- /******************************************************************************
- 'cdwGetDevCaps' retrieves the device capabilites of a CDWFS drive
- see description of the CDWACC_DEV_CAPS structure for more details
- ******************************************************************************/
- CDWACCLNK cdwGetDevCaps (char *drive_ltr,
- CDWACC_DEV_CAPS *dev_caps);
-
- /******************************************************************************
- 'cdwGetParms' returns the current file system settings. These settings
- are also displayed in the drives' property sheet (in "My Computer")
- ******************************************************************************/
- CDWACCLNK cdwGetParms (char *drive_ltr,
- CDWACC_FSPARMS *pfsparms);
-
- /******************************************************************************
- 'cdwSetParms' sets the new file system settings. These settings are stored
- as default values for the drive specified (remain after reboot)
- ******************************************************************************/
- CDWACCLNK cdwSetParms (char *drive_ltr,
- CDWACC_FSPARMS *pfsparms);
-
- /******************************************************************************
- 'cdwFormat' formats a new CD
- THIS IS AN OBSOLETE FUNCTION and does not need to be called anymore
- ******************************************************************************/
- CDWACCLNK cdwFormat (char *drive_ltr);
-
- /******************************************************************************
- 'cdwUnseal' removes the write protection from a sealed CD (a CD closed with
- the CDWACC_UMOUNT_SEAL mode)
- ******************************************************************************/
- CDWACCLNK cdwUnseal (char *drive_ltr);
-
- /******************************************************************************
- 'cdwEraseCDRW' erases a CD-RW completely.
- There must be no open/modified sessions on the CD before executing this
- command
- ******************************************************************************/
- CDWACCLNK cdwEraseCDRW (char *drive_ltr);
-
- /******************************************************************************
- 'cdwGetCDInfo' retrieves information about a CD that can be used for
- displaying a chkdsk result etc.
- ******************************************************************************/
- CDWACCLNK cdwGetCDInfo (char *drive_ltr,
- CDWACC_CD_INFO *pcdinfo,
- CDWACC_VOL_INFO *should_be_NULL,
- long *free_space,
- long *disk_space);
-
- /******************************************************************************
- 'cdwUmount' closes the current session.
- For available modes, see the CDWACC_UMOUNT_MODE enumeration above
- NOTE:
- This function does not return an error if the drive specified is
- currently not mounted (or no CD inserted)
- ******************************************************************************/
- CDWACCLNK cdwUmount (char *drive_ltr,
- CDWACC_FINALIZE_MODE mode,
- CDWACC_VOL_INFO *should_be_NULL);
-
- /******************************************************************************
- 'cdwGetVersion' returns version information for this library.
- To retrieve the file system version, use the 'cdwGetFSParms' command
- ******************************************************************************/
- CDWACCLNK cdwGetVersion (BYTE *major, BYTE *minor);
-
-
- /******************************************************************************
- 'cdwEjectMedium' ejects the medium in the specifed drive
- ******************************************************************************/
- CDWACCLNK cdwEjectMedium (char *drv_ltr);
-
-
- /******************************************************************************
- 'cdwSetBootFile' makes a CD bootable. 'boot_image_file' must be located
- on the CD before calling this function.
- ******************************************************************************/
- CDWACCLNK cdwSetBootfile (char *drive_ltr,
- char *boot_image_file);
-
- /******************************************************************************
- 'cdwQueryCacheStatus' returns information about the current file system
- cache usage
- NOTE: Currently, the unit used for 'cache_size' and 'cache_status'
- depends on the recorder driver, so this information is useful
- for percent-like calculations only.
- Example:
- filled_percent = used_cache / cache_size * 100
- ******************************************************************************/
- CDWACCLNK cdwQueryCacheStatus (char *drive_ltr,
- unsigned long *cache_size,
- unsigned long *used_cache);
-
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* _CDWACC_H_ */